<include file="Public:header" />
<style>.header{display:none;}
.w790{margin-top:0px;}
.UserList a{padding:5px; display:block; float:left; border:1px solid #CCC;}
</style>

<script>
    function addUser(uid){
        $.post('{:U('addUser')}',
            {
                'user_id':uid,
                'sid':{$info.id}
    },
        function(data){
            if(data.status > 0){
                $('<a id="user_'+uid+'" onclick="delUser('+uid+');" href="javascript:void(0);">'+data.data+'</a>').appendTo('.UserList');
            }else{
                error(data.info);
            }
        },
        'json'
    );
    }

    function delUser(uid){
        $.post('{:U('delUser')}',
            {
                'user_id':uid,
                'sid':{$info.id}
    },
        function(data){
            if(data.status > 0){
                $('#user_'+data.data).remove();
            }else{
                error(data.info);
            }
        },
        'json'
    );
    }
</script>

<div class="container main"> <include file="Public:left" />
    <div class="w790">
        <h1>当前供货商：{$info.susername},管理员列表如下：</h1>

        <div class="UserList"><volist name="curUserList" id="vo">
            <a id="user_{$vo.id}" onclick="delUser({$vo.id});" href="javascript:void(0);">{$vo.nickname}</a>
        </volist></div>


        <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
            <thead>
            <tr>
                <td align="center">ID</td>
                <td align="center">登录名</td>
                <td align="center">昵称</td>
            </tr>
            </thead>
            <volist name="list" id="vo">
                <tr class="data_list">
                    <td align="center"><input type="checkbox" name="id" id="id" class="sall" value="{$vo.id}" /></td>
                    <td style="text-indent:{$vo['cl']*10}px"><gt name="vo['cl']" value="0">|-</gt>      {$vo.account}</td>
                    <td><a onclick="addUser({$vo.id});" href="javascript:void(0);">{$vo.nickname}</a></td>

                </tr>
            </volist>

            <tr>
                <td colspan="10" align="center"><div class="pages">{$pages}</div></td>
            </tr>
        </table>

    </div>
    <div class="clear"></div>
</div>
</body></html>